package com.ddwl.schema.bo.goods.retail;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * @Author hemiaojun
 * @Date 2021/4/14 15:06
 */
@ApiModel("打折商品skuBo")
@Getter
@Setter
public class DiscountItemSkuBo {

    @NotNull(message = "子商品ID不能为空")
    @ApiModelProperty("子商品ID")
    private String skuId;

    @NotNull(message = "商品ID不能为空")
    @ApiModelProperty("商品ID")
    private String itemId;

    @NotNull(message = "多规格商品描述信息不能为空")
    @ApiModelProperty("多规格商品描述信息")
    private String itemSpecs;

    @NotNull(message = "sku图片不能为空")
    @ApiModelProperty("sku图片")
    private String imageUrl;

    @NotNull(message = "零售价不能为空")
    @DecimalMin(value = "0.01",message = "零售价不能小于0.01")
    @DecimalMax(value = "10000000.00",message = "零售价不能大于10000000.00")
    @ApiModelProperty("零售价")
    private BigDecimal retailPrice;

    @ApiModelProperty("商品编码")
    @Length(max = 32,message = "商品编码不能超过32位")
    private String barcode;

    /**
     * 折扣价格
     */
    @NotNull(message = "折扣价格不能为空")
    @DecimalMin(value = "0.01",message = "折扣价格不能小于0.01")
    @ApiModelProperty(value="折扣价格",required = true)
    private BigDecimal discountPrice;

    /**
     * 商品佣金
     */
    @DecimalMin(value = "0.01",message = "商品佣金不能小于0.01")
    @ApiModelProperty(value="商品佣金")
    private BigDecimal itemCommission;

    /**
     * 折扣
     */
    @NotNull(message = "折扣不能为空")
    @DecimalMin(value = "0.1",message = "折扣不能小于0.1")
    @DecimalMax(value = "9.9",message = "折扣不能大于9.9")
    @ApiModelProperty(value="折扣",required = true)
    private BigDecimal discount;

    /**
     * 库存
     */
    @NotNull(message = "库存不能为空")
    @ApiModelProperty(value="库存",required = true)
    private Integer stock;


}
